Skip to content

Fix: Restrict non-owner from attaching pam scripts#2175

Merged
amangalampalli-ks merged 2 commits into
fix/restrict-pam-rotation-script-attachmentfrom
fix/restrict-pam-rotation-script-attachment-int
Jun 29, 2026
Merged

Fix: Restrict non-owner from attaching pam scripts#2175
amangalampalli-ks merged 2 commits into
fix/restrict-pam-rotation-script-attachmentfrom
fix/restrict-pam-rotation-script-attachment-int

Conversation

@amangalampalli-ks

@amangalampalli-ks amangalampalli-ks commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Commander now marks post-rotation script uploads so the backend can enforce owner-only attachment. Previously, script files were uploaded like normal attachments with no way for the server to tell them apart.

Changes

  • attachment.py — add is_script on upload tasks; pass through to vault/files_add; clearer error on script upload rejection
  • discoveryrotation.py / discoveryrotation_v1.py — set is_script=True in PAMScriptAddCommand
  • pam_import/base.py — same for PAM import script uploads
  • Other FileUploadTask callers unchanged (is_script=False)

Tested

  • Owner: pam rotation script add succeeds
  • Non-owner: blocked once backend owner checks are live
  • Normal attachments still upload without the flag

@amangalampalli-ks amangalampalli-ks self-assigned this Jun 26, 2026
@amangalampalli-ks
amangalampalli-ks marked this pull request as ready for review June 26, 2026 14:28
@amangalampalli-ks
amangalampalli-ks merged commit 29bd055 into fix/restrict-pam-rotation-script-attachment Jun 29, 2026
4 checks passed
amangalampalli-ks added a commit that referenced this pull request Jun 29, 2026
* Flag rotation script uploads with is_script for owner-only server enforcement

* Undo ssl changes
sk-keeper pushed a commit that referenced this pull request Jun 29, 2026
* Flag rotation script uploads with is_script for owner-only server enforcement

* Undo ssl changes
sk-keeper pushed a commit that referenced this pull request Jul 2, 2026
* Flag rotation script uploads with is_script for owner-only server enforcement

* Undo ssl changes
jpkeepersecurity pushed a commit that referenced this pull request Jul 3, 2026
* Flag rotation script uploads with is_script for owner-only server enforcement

* Undo ssl changes
@adeshmukh-ks
adeshmukh-ks deleted the fix/restrict-pam-rotation-script-attachment-int branch July 16, 2026 04:44
pvagare-ks pushed a commit that referenced this pull request Jul 16, 2026
* Flag rotation script uploads with is_script for owner-only server enforcement

* Undo ssl changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants